var vm = new Vue({
    el: '#main',
    data: {
        item: {}, //详情
        id: '', //长文章id
        page: 1,
        comt: [], //评论列表
        pid: '', //被回复人id
        token: '',
        resindex: '', //背回复的二级回复index
        cid: '', //评论id,用于删除评论
        iscol: '1', //是否收藏 默认否
        isup: '1', // 是否点赞 默认否
        content: ''
    },
})

var id = getUrlParam('id');


var Info = {
    init: function () {
        Info.content(); //详情加载
        Info.comments()
    },
    content: function () { //详情加载
        $.ajax({
            url: URL.path + '/longarticle/longarticle_detailh5',
            type: 'post',
            data: {
                id: id,
                terminalNo: '3',
            },
            success: function (data) {
                if (data.returnCode == 200) {
//							alert(JSON.stringify(data.data))
                    data.data.zanlength = data.data.zan_user.length;
                    vm.item = data.data;
                    vm.iscol = data.data.is_collect;
                    vm.isup = data.data.is_praise;
                } else {
                    if (data.returnCode == 401) {
                        unLoginComfirm();
                    } else {
                        mui.toast(data.msg)
                    }
                }
                var currentView = plus.webview.currentWebview();
                currentView.show('slide-in-right', 300);
                plus.nativeUI.closeWaiting();
            },
            error: function (xhr, err) {
                console.log(err)
            }
        })
    },
    comments: function () {
        $.ajax({
            url: URL.path + '/longarticle/circle_comments',
            type: "post",
            data: {
                id: id,
                type: '2',
                page: vm.page,
                terminalNo: '3'
            },
            success: function (data) {
                if (data.returnCode == 200) {

                    vm.comt = data.data;
                }
            }
        })
    }

}
Info.init();




